#region Copyright
/// <copyright>
/// Copyright (c) 2007 Ilia Shramko.
/// Released under the terms of the GNU General Public License.
/// </copyright>
#endregion

using System;

namespace Osh.Epg
{
	/// <summary>
	/// Summary description for EpgEvent.
	/// </summary>
	public class EpgEvent
	{
		private DateTime _startTime;
		private DateTime _endTime;
		private string _language;
		private string _name;
		private string _description;

		public EpgEvent(DateTime startTime, int duration, string language, string name, string description)
			: this(startTime, startTime.AddSeconds(duration), language, name, description)
		{
		}

		public EpgEvent(DateTime startTime, DateTime endTime, string language, string name, string description)
		{
			if(endTime < startTime)
				throw new ArgumentOutOfRangeException("endTime");

			_startTime = startTime;
			_endTime = endTime;
			_language = language;
			_name = name;
			_description = description;
		}

		public DateTime StartTime
		{
			get { return _startTime; }
		}

		public DateTime EndTime
		{
			get { return _endTime; }
		}

		public int Duration
		{
			get { return (int)(_endTime - _startTime).TotalSeconds; }
		}

		public string Language
		{
			get { return _language; }
		}

		public string Name
		{
			get { return _name; }
		}

		public string Description
		{
			get { return _description; }
		}
	}
}
